/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package models.monorent;

import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

import models.*;
/**
 *
 * @author xuyuhang1005
 */
@Entity
public class RentInfoImage extends Model {
	public Blob image;
    public float iorder;
	
	@ManyToOne
	public RentInfo rentinfo;
	
	public RentInfoImage() {
	}
	
	public boolean hasImage() {
		if(this.image != null) {
			if(this.image.exists()) {
				return true;
			}
		}
		return false;
	}
	
	public boolean distroyImage() {
		if(this.hasImage()) {
			return this.image.getFile().delete();
		}
		return true;
	}
}
